#!/usr/bin/env python
#-*- coding: utf-8 -*-
# Dont be afraid, we just need map-editor
import sys, pygame, cPickle
import sprites

dungeons = list()

#### Fix no-group problem
bla = pygame.sprite.Group()
sprites.lock.groups = bla
sprites.dungeon.groups = bla

###############################################
floor = "floor1"
c = sprites.chest(sprites.item('crystalknife', 15, 10, 10, "knifee", "weapon"),"chest1dc")
c.x = 9
c.y = 6
s = sprites.readbook('book','book1','book1')
i = sprites.wall("krych", True)
w = sprites.wall("wall2")
wt = sprites.wall("wall2t")
wtl = sprites.wall("wall2tl")
wtr = sprites.wall("wall2tr")
wbl = sprites.wall("wall2bl", True)
wbr = sprites.wall("wall2br")
f = sprites.floor("floor1")
p = sprites.portal("portal1", 1,(1,10))
m1 = sprites.char('protDion', "pl3")
m1.hp = 5
m1.x = 18
m1.y = 9
#exp sys
m1.exp = 10
#gold sys
m1.gold = 10

m2 = sprites.char('protDion', "pl3")
m2.hp = 5
m2.x = 18
m2.y = 10
#exp sys
m2.exp = 10
#gold sys
m2.gold = 10

m3 = sprites.char('protDion', "pl3")
m3.hp = 5
m3.x = 18
m3.y = 11
#exp sys
m3.exp = 10
#gold sys
m3.gold = 10

iB = sprites.char('bigCrystal', "bigKrych")
iB.x = 15
iB.y = 12
B1 = sprites.bigSprite(iB,(16,12))
B2 = sprites.bigSprite(iB,(15,13))
B3 = sprites.bigSprite(iB,(16,13))
#exp sys
iB.exp = 10
#gold sys
iB.gold = 10

l = sprites.lock('crystalPass', "krych", [(m1.x,m1.y),(m2.x,m2.y),(m3.x,m3.y)], f)
F = False
P = sprites.potion()
P.x = 2
P.y = 4

dung = [
        [wtl,wt,wt,wtr,F,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,F,F,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w],
        [w,f,s,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,i,f,f,f,i,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,P,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,wbl,wt,wbr,f,f,i,i,f,f,i,f,f,f,f,f,m1,w,w,w,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,c,i,f,f,f,f,f,f,f,f,m2,l,l,l,l,f,f,f,f,f,f,f,f,f,f,f,f,p,w],
        [w,f,f,w,w,w,f,f,i,i,f,f,f,f,f,f,f,f,m3,w,w,w,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,iB,B1,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,B2,B3,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,w,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w,F,F,w,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,w,w,w,F,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,F,F,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w]
       ]
#####################################################


dungeons.append((dung, floor))


#################################

c = sprites.chest(sprites.item('crystalArmor', 15, 15, 10, "shirt", "armor"),"chest1dc")
c.x = 9
c.y = 6
i = sprites.wall("krych")
w = sprites.wall("wall1")
f = sprites.floor("floor1")
p1 = sprites.portal("portal1", 0,(18,10))
m1 = sprites.char('protDion', "pl3")
m1.hp = 5
m1.x = 18
m1.y = 9
#gold sys
m1.gold = 10

m2 = sprites.char('protDion', "pl3")
m2.hp = 5
m2.x = 18
m2.y = 10
#gold sys
m2.gold = 10

m3 = sprites.char('protDion', "pl3")
m3.hp = 5
m3.x = 18
m3.y = 11
#gold sys
m3.gold = 10

l = sprites.lock('crystalPass', "krych", [(m1.x,m1.y),(m2.x,m2.y),(m3.x,m3.y)], w)
floor = "floor1"

dung = [
        [w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,i,f,f,i,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,c,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,i,f,f,f,i,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,i,f,f,i,f,f,f,f,f,m1,w],
        [p1,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,m2,l],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,m3,w],
        [w,f,f,f,f,f,f,i,f,f,f,f,i,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,i,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w],
        [w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w]
       ]

dungeons.append((dung, floor))
cPickle.dump(dungeons, open('dungs.upf', 'w'))
